Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix error when loading SequenceMeta as dict #310

Merged
merged 4 commits into from
Feb 2, 2024

Conversation

fdrgsp
Copy link
Contributor

@fdrgsp fdrgsp commented Feb 2, 2024

fix SequenceMeta /dict error in tests not passing both locally and in in #309: FAILED tests/test_multid_widget.py::test_saving_mda[splitC-nT=0-nZ=0-nC=1] - AttributeError: 'dict' object has no attribute 'split_channels'

note: new test added

Copy link

codecov bot commented Feb 2, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (c43442a) 78.24% compared to head (8b203b4) 78.15%.

Files Patch % Lines
...rc/napari_micromanager/_gui_objects/_mda_widget.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #310      +/-   ##
==========================================
- Coverage   78.24%   78.15%   -0.09%     
==========================================
  Files          15       15              
  Lines         671      673       +2     
==========================================
+ Hits          525      526       +1     
- Misses        146      147       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -49,21 +49,20 @@ def value(self) -> MDASequence:
split_channels=bool(split),
save_dir=widget_meta.get("save_dir", ""),
file_name=widget_meta.get("save_name", ""),
should_save=bool("save_dir" in widget_meta),
should_save="save_dir" in widget_meta,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did the linter remove this? or did you?

@tlambert03
Copy link
Member

#311 was a more granular fix to the test. the underlying issue has to do with useq schema's replace() method converting objects to dicts. while this approach would technically work, it depends on the sequence first going through a widget setValue method. So, it's not "wrong" per se, but it's a bit orthogonal to the core problem. I'm going to reduce this down to a simple cast-dict-to-sequence and remove the rest of the PR

@tlambert03 tlambert03 merged commit e5a6f9c into pymmcore-plus:main Feb 2, 2024
16 of 17 checks passed
@fdrgsp fdrgsp deleted the fix_meta_error branch May 27, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants